/*
 * @Author: your name
 * @Date: 2022-03-29 22:18:41
 * @LastEditTime: 2022-05-17 14:48:49
 * @LastEditors: 陈宇 975155172@qq.com
 * @Description: 文章接口对象
 * @FilePath: \blog-api\src\abstract\dto\create-post.dot.ts
 */

import { ApiProperty } from '@nestjs/swagger';

export class CreatePostDto {
    @ApiProperty({ description: '文章标题' })
    readonly title: string;
    @ApiProperty({ description: '分类' })
    readonly categories: string;
    @ApiProperty({ description: '描述' })
    readonly tag: string;
    @ApiProperty({ description: '页码' })
    readonly page: number;
    @ApiProperty({ description: '每页数量' })
    readonly page_count: number;
}

export class AbstractBase {
    id: number | string;    // id
    title?: string; // 标题
    author?: string;    // 作者
}

export class AbstractDto {
    list?: AbstractBase[];
    total?: number | string;
    page?: number | string;
    pageCount?: number | string;
    pageSize?: number | string;
}

// 文章显示状态修改状态
export class AbstractShowType {
    id: number | string;    // id
    isShow?: string; // 标题
}

// 添加 / 修改 文章的字段类型
export class AddAbstractDto {
    id?: number; // 文章唯一ID
    title?: string; // 标题
    content?: string; // 内容
    categories?: number | string; // 分类
    tags?: number | string; // 标签
    describe_content?: string; // 描述
}

// 获取文章详情的字段类型
export class AbstractDetailsDto {
    id: string | number; // id
}